import { getAction, postAction } from '../manage'

// 树形菜单列表
const tree = (params) => getAction('/admin/menu/tree', params)
// 删除菜单
const del = (params) => postAction(`/admin/menu/delete/${params}`)
// 批量删除菜单
const batchDel = (params) => postAction(`/admin/menu/batchDel`, params)
// 新增菜单
const create = (params) => postAction('/admin/menu/create', params)
// 编辑菜单
const edit = (params) => postAction('/admin/menu/update', params)
// 导出菜单
const exports = (params) => postAction('/admin/menu/export', params, 'blob')
// 下载菜单模板
const download = (params) => postAction('/admin/menu/download', params, 'blob')
// 导入菜单
const imports = (params) => postAction('/admin/menu/import', params)

export {
  tree,
  del,
  batchDel,
  create,
  edit,
  exports,
  download,
  imports
}
